При компиляции кода выходит ошибка “Index in position 1 exceeds array bounds. Index must not exceed 1.” в строке uxx. Как исправить?
unew = zeros(Nx+1,Nt+1);
unew(:,1) = u;
unew(1,:) = 0;
unew(Nx+1,:) = 0;
for j=1:Nt
for i=2:Nx-1
uxx = (u(i+1,j) – 2*u(i,j) + u(i-1,j))/h^2;
uxxx = (u(i+2,j) – 2*u(i+1,j) + 2*u(i-1,j) – u(i-2,j))/(2*h^3);
unew(i,j+1) = u(i,j) + k*(-uxx + u(i,j)*(u(i,j+1) – u(i,j-1))/(2*h) – uxxx);
end
end